import { apiClient } from '../index';

// 资金费率评分接口
export const getFundingRateScores = async (params: {
  limit: number;
  offset: number;
}) => {
  try {
    const response = await apiClient.post('/scores/funding/query', params);
    return response;
  } catch (error) {
    console.error('获取资金费率评分失败:', error);
    throw error;
  }
};

// 资金费率历史评分接口
export const getFundingRateHistory = async (params: {
  symbol: string;
  exchange: string;
  days: number;
}) => {
  try {
    const response = await apiClient.post('/scores/funding/history', params);
    return response;
  } catch (error) {
    console.error('获取资金费率历史评分失败:', error);
    throw error;
  }
};

// 价差套利评分接口
export const getSpreadArbitrageScores = async (params: {
  limit: number;
  offset: number;
}) => {
  try {
    const response = await apiClient.post('/scores/spread/query', params);
    return response;
  } catch (error) {
    console.error('获取价差套利评分失败:', error);
    throw error;
  }
};

// 价差套利历史评分接口
export const getSpreadArbitrageHistory = async (params: {
  symbol: string;
  exchanges: string;
  days: number;
}) => {
  try {
    const response = await apiClient.post('/scores/spread/history', params);
    return response;
  } catch (error) {
    console.error('获取价差套利历史评分失败:', error);
    throw error;
  }
};